//1t

import java.util.ArrayList;
import java.util.List;

public class Solution {
    public List<String> letterCasePermutation(String s) {
        List<String> res = new ArrayList<>();
        dfs(s, 0, "", res);
        return res;
    }

    private void dfs(String s, int index, String path, List<String> res) {
        if (index == s.length()) {
            res.add(path);
            return;
        }

        char c = s.charAt(index);
        if (Character.isDigit(c)) {
            dfs(s, index + 1, path + c, res);
        } else {
            // 转换大小写
            dfs(s, index + 1, path + Character.toLowerCase(c), res);
            dfs(s, index + 1, path + Character.toUpperCase(c), res);
        }
    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        String s1 = "a1b2";
        System.out.println(solution.letterCasePermutation(s1));
        String s2 = "3z4";
        System.out.println(solution.letterCasePermutation(s2));
        
    }
}




//2t




//3t